package cn.edu.scau.cmi.maikejian.composite.consistent;

import java.util.Set;

public class Personal  extends Orangization{
            
	private String name;
	
    public Personal(String name) {
		this.name = name;
		type = "Personal";
	}
	@Override
	public String op() {
		
		return null;
	}
	@Override
	public Orangization getParent() {
		
		return this.getParent();
	}
	@Override
	public Orangization addChild(Orangization child) {
		System.out.println("对不起，该节点是叶节点，没有子节点可以删除");
		return this;      		
	}
	@Override
	public Orangization deleteChild(Orangization child) {
		System.out.println("对不起，该节点是叶节点，没有子节点可以删除");
		return this;      		
	}
	
	@Override
	public Set<Orangization> getChildren(){
		System.out.println("对不起，该节点是叶节点，没有子节点");
		return null;
	}
	 @Override
     public boolean equals(Object ob) {
     	Personal personal = (Personal) ob;
     	
     	if(personal.name.equals(this.name))
     		return true;
     	return false;
     	
     }
    @Override
    public int hashCode() {
 	   return 1;
    }
	public String getName() {
		return name;
	}
	
	public void setName(String name)
	{
		this.name = name;
	}
}
